<template>
	<view>
		<view class="header">
			<view class="tou">综合排序</view>
			<view class="tou">销量</view>
			<view class="tou">价格</view>
			<view class="tou">好评度</view>
			<view class="tou">店铺</view>
			<view class="tou">筛选</view>
		</view>
		<view class="centen" v-for="item in goodlist" :key="item.id" @click="tiao(item.id)">
			<view class="img">
				<image :src="'http://localhost:3000' + item.img" mode=""></image>
			</view>
			<view class="centen1">
				<view class="xi1">{{item.goodsname}}</view>
				<view class="qian">
					<view class="qian2">￥ {{item.price}}</view>
					<del class="qian3">￥{{item.market_price}}</del>
				</view>
				<view class="shaung">双十一限制</view>
				<view class="shu">
					<text>3565评论</text>
					<text>99%好评</text>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	import {
		Search
	} from '@/reuqust/api.js'
	export default {
		data() {
			return {
				goodlist: []
			}
		},
		onLoad(options) {
			console.log(options, '1111');
			Search({
				keywords: options.id
			}).then(res => {
				console.log(res, '响应');
				if (res.data.code == 200) {
					this.goodlist = res.data.list
				}
			})

		},
		methods: {
			tiao(i) {
				console.log(i, '111');
				uni.navigateTo({
					url: '../detail/detail?id=' + i
				})
			}
		}
	}
</script>

<style lang="scss">
	.title {
		background-color: red;
	}

	.header {
		display: flex;
		background: red;
		justify-content: space-around;
	}

	.header .tou {
		color: white;
	}

	.centen {
		display: flex;
	}

	.centen .img image {
		width: 218rpx;
		height: 219rpx;
		margin-left: 40rpx;
		margin-top: 40rpx;
	}

	.centen1 .xi1 {
		font-size: 032rpx;
		color: #333333;
		line-height: 32rpx;
		margin-left: 40rpx;
		margin-top: 51rpx;
	}

	.qian {
		display: flex;
	}

	.qian .qian2 {
		font-size: 40rpx;
		color: #FF6040;
		line-height: 16rpx;
		margin-left: 40rpx;
		margin-top: 40rpx;
	}

	.qian .qian3 {
		font-size: 40rpx;
		color: #999999;
		line-height: 16rpx;
		// margin-left: 40rpx;
		margin-top: 40rpx;
	}

	.centen1 .shaung {
		width: 220rpx;
		height: 34rpx;
		background: #FF8066;
		margin-left: 40rpx;
		font-size: 16rpx;
		color: #FFFFFF;
		line-height: 34rpx;
		text-align: center;
		margin-top: 20rpx;
	}

	.shu text {
		font-size: 20rpx;
		color: #999999;
		line-height: 20rpx;
		margin-left: 40rpx;
	}
</style>
